<template>
    <div>
        <div class="bg"></div>
            <div class="topList">
                <router-link to="/appmain" class="topBtn">
                <i class="iconfont arrow-left">&#xe641;</i><span class="dataInteract">数据中心</span>
                </router-link>
            </div>
            <div class="contentList">
                <div class="dataInfo">
                    <div class="courseTitle">
                       <p class="courseNameTitle">课程名称</p>
                       <p class="courseStatuTitle">互动结果</p>
                    </div>
                   <div class="courseItem" v-for="(item, index) in scorelist" :key="index"> 
                       <p class="courseName">{{ item.couname }}</p>
                       <p class="courseStatu">
                           <span :class="item.score1 == item.score2 ?'':'nocomplete'">{{ item.score1 }}</span> <span>/{{ item.score2 }}</span>
                        </p>
                   </div>
                   <div v-show="scorelist.length == 0" class="noCourse">暂无互动结果</div>
                </div>
            </div>
            <div class="bottombar">
                <router-link to='/appmain'>
                    <img src="../../assets/app/home.png" alt="">
                </router-link>                
            </div>       
    </div>
</template>
<script>
export default {
  data() {
    return {
      studentinfo: "", //学员数据
      scorelist: []
    };
  },
  //初始化
  mounted() {
    //初始化
    this.initload();
  },
  //事件
  methods: {
    initload() {
      this.studentinfo = JSON.parse(localStorage.getItem("studentinfo")); //学员信息
      this.$axios
        .get("/Interact/getscorelist", {
          params: { stcard: this.studentinfo.St_Card }
        })
        .then(json => {
          var result = JSON.parse(json.data);
          if (result.length > 0) {
            var scoredata = [];
            for (let i = 0; i < result.length; i++) {
              var score = result[i].Score_fruit.split("/");
              var item = {
                couname: result[i].Cos_Name,
                score1: score[0],
                score2: score[1]
              };
              scoredata[i] = item;
            }
            this.scorelist = scoredata;
          }
        });
    }
  }
};
</script>

<style scoped>
.bg {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  /* background-image: linear-gradient( 135deg, #0396FF 10%, #ABDCFF 100%); */
  z-index: -1;
  width: 100%;
  /* height: 10rem; */
  background: #ececec;
}
@font-face {
  font-family: "iconfont"; /* project id 1514769 */
  src: url("//at.alicdn.com/t/font_1514769_lvnalmnmtng.eot");
  src: url("//at.alicdn.com/t/font_1514769_lvnalmnmtng.eot?#iefix")
      format("embedded-opentype"),
    url("//at.alicdn.com/t/font_1514769_lvnalmnmtng.woff2") format("woff2"),
    url("//at.alicdn.com/t/font_1514769_lvnalmnmtng.woff") format("woff"),
    url("//at.alicdn.com/t/font_1514769_lvnalmnmtng.ttf") format("truetype"),
    url("//at.alicdn.com/t/font_1514769_lvnalmnmtng.svg#iconfont") format("svg");
}
.iconfont {
  font-family: "iconfont" !important;
  font-size: 25px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  vertical-align: bottom;
}
.topList {
  height: 11rem;
  width: 100%;
  line-height: 2.5rem;
  /* border:1px solid red; */
  text-align: center;
  font-size: 18px;
  background-image: linear-gradient(135deg, #0396ff 10%, #abdcff 100%);
}
.topBtn {
  text-decoration: none;
  color: white;
  display: inline-block;
  width: 100%;
}
.dataInteract {
  margin-left: -2rem;
}
.arrow-left {
  float: left;
}
.contentList {
  width: 83%;
  margin: -7rem auto;
  /* height: 25rem; */
  /* border:1px solid red; */
  border-radius: 10px;
  background: white;
  padding-bottom: 2rem;
  margin-bottom: 80px;
  padding-left: 10px;
  padding-right: 10px;
}
p {
  margin: 0;
  padding: 0;
}
.courseList {
  border-bottom: 1px solid #e5e5e5;
  padding: 15px 10px;
  text-align: center;
  color: #0396ff;
  font-size: 20px;
}
.courseTitle {
  color: darkorange;
}
.courseTitle,
.courseItem {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
  padding: 10px 5px;
  text-align: center;
  font-size: 16px;
}
p {
  margin: 0;
  padding: 0;
}
.courseNameTitle,
.courseName {
  flex: 3;
}
.courseName {
  color: #a0a0a0;
}
.courseStatuTitle,
.courseStatu {
  flex: 1;
}
.courseStatu {
  color: #73d25a;
}
.nocomplete {
  color: red;
}
.noCourse {
  color: #a0a0a0;
  text-align: center;
}
.bottombar {
  position: fixed;
  z-index: 900;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  border: 1px solid white;
  height: 50px;
  text-align: center;
  background: #0396ff;

  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.1) inset;
}
.bottombar img {
  background: white;
  padding: 10px;
  border-radius: 50%;
  position: relative;
  /* top: -20px; */
  text-shadow: 0 1px rgba(0, 0, 0, 0.3);
  /* border: 5px solid gray; */
}
</style>
